package cn.wx.scholar.core.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.wx.common.persistence.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import cn.wx.scholar.core.service.NewsService;
import cn.wx.scholar.core.entity.News;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.core.entity.qo.NewsQ;
/**
 *   @description : News 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-07-15
 */
@RestController
@RequestMapping("/sholar/news")
public class NewsController extends BaseController {

    @Autowired
    private NewsService newsService;

    /**
     * @description : 通过条件获取News
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-07-15
     */
    @RequestMapping(value = "/query/unique", method = RequestMethod.POST)
    public ResponseData queryUnique(@RequestParam(value="fId") Long fId) throws Exception {
    	NewsQ newsQ = new NewsQ();
    	newsQ.setfId(fId);
        return success(newsService.queryUnique(newsQ,News.class));
    }

   
}